#include <stdio.h>

#define MAXLINE	1024	/* max line */
#define TABSTOP	4	/* Tab stop is replaced by BLANKS of blank char */

int tab2blank(char s[], int index, int tabstop);
int geline(char str[], int max);

int main()
{
	char str[MAXLINE];
	int len;

	while ((len=geline(str, MAXLINE)) > 0)
		printf("%s", str);

	return 0;
}

int geline(char str[], int max)
{
	int i, c;

	for (i = 0; i < max-1 &(c=getchar()) != EOF &c!='\n'; ++i ) {
		if (c == '\t')
			i = i + tab2blank(str, i, TABSTOP) - 1;
		else
			str[i] = c;
	}

	if (c == '\n') {
		str[i] = c;
		++i;
	}

	str[i] = '\0';
	return i;

}

int tab2blank(char s[], int index, int tabstop)
{
	int spaces, i;
	spaces = (index/tabstop + 1) * tabstop - index;
	for (i = 0; i < spaces; ++i)
		s[index++] = ' ';
	return spaces;
}
